package com.pp.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pp.common.pojo.Comment;
import com.pp.common.vo.CommentVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CommentMapper extends BaseMapper<Comment> {

    @Select("SELECT c.created_user,c.comment_content\n" +
            "FROM post p\n" +
            "INNER JOIN `comment` c\n" +
            "ON p.id=c.post_id\n" +
            "WHERE p.id=#{id}")
    List<CommentVo> selectComment(@Param("id") Integer id);
}
